﻿Imports NENAData.LINQ

Partial Public Class TransactionReceipts
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        BindGridView()
    End Sub
    Protected Sub BindGridView()
        Dim intAffiliateID As Integer

        intAffiliateID = CType(Request.QueryString("AffiliateID"), Integer)
        Dim oPayments As New NENAData.Transactions.Payments.Payments
        Dim oTransactionPayments As List(Of TransactionPayment)
        'Dim oFilteredTP As List(Of TransactionPayment)

        oTransactionPayments = oPayments.GetTransactionPaymentsbyAffiliate(intAffiliateID)

        Dim oFilteredTP = (From tp In oTransactionPayments _
               Where tp.PaymentStatus = ddl_PaymentStatus.SelectedValue.ToString _
              Order By tp.PaymentDate Descending _
             Select tp).ToList
        'If chkPaidTransaction.Checked Then
        '        oFilteredTP = (From tp In oTransactionPayments _
        '          Where tp.TransactionCompleted = True _
        '        Order By tp.PaymentDate Descending _
        '      Select tp).ToList
        '    End If

        'gv_Transactions.DataSource = oFilteredTP
        listCompletedTransactions.DataSource = oFilteredTP

        'gv_Transactions.DataBind()
        listCompletedTransactions.DataBind()
    End Sub
    Protected Function GetMemberName(ByVal strMemberID As String) As String
        If strMemberID.Length < 2 Then
            Return "N/A"
        End If

        Dim x As New NENAData.NENAMember.NENAMember
        'Dim omember = x.GetMember(403)
        Dim omember = x.GetMember(CType(strMemberID, Integer))

        Return omember.FirstName + " " + omember.LastName

    End Function
End Class